
<script setup>
import Header from '../../components/Header.vue';
import { ref, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import Status from '../../components/Status.vue';
import titles from '../../components/titles.vue'

let route = useRoute();
let formData = ref([]);

onMounted(() => {
    let id = route.params.id;
    let submissions = JSON.parse(localStorage.getItem('formData') || '[]');
    formData.value = submissions[id] || null;
})
</script>



<template>
    <Header></Header>
    <div class="content">
        <titles :title="'Apply Credentials / Details'"></titles>
        <div class="box">
            <div class="left-box">
                <div class="left-box-active">
                    <p>
                        <RouterLink to="/MyCredentials">My Credentials</RouterLink>
                    </p>
                </div>
                <div>
                    <p>
                        <RouterLink to="/ApplyCredentials">Apply Credentials</RouterLink>
                    </p>
                </div>
                <div>
                    <p>
                        <RouterLink to="/AccountInformation">Account Information</RouterLink>
                    </p>
                </div>
            </div>
            <div class="right-box">
                <div class="right-box-title">
                    <p class="title">Details</p>
                </div>

                <div class="right-box-between">
                    <div class="right-box-between-one">
                        <div class="right-box-between-one-box">
                            <p>Application ID</p>
                            <p>{{ formData.ApplicationID }}</p>
                        </div>
                        <div class="right-box-between-one-box">
                            <p>Application Date</p>
                            <p>{{ formData.ApplicationDate }}</p>
                        </div>
                        <div class="right-box-between-one-box">
                            <p>Application State</p>
                            <div class="button">
                                    <!-- {{ formData.Statuss }} -->
                                 <Status :status="formData.Statuss"></Status>
                            </div>
                        </div>
                        <div class="right-box-between-one-box">
                            <p>Real-person Authorization</p>
                            <p>Completed</p>
                        </div>
                    </div>

                    <div class="right-box-between-two">
                        <div class="right-box-between-two-title"><b>University Certificate</b></div>
                        <div class="right-box-between-two-type">
                            <div>Name</div>
                            <div>Sex</div>
                            <div>Date of Birth</div>
                        </div>
                        <div class="right-box-between-two-name" v-if="formData">
                            <div>{{ formData.Name }} </div>
                            <div>{{ formData.Gender }} </div>
                            <div>{{ formData.DateOfBirth }} </div>
                        </div>
                        <div class="right-box-between-two-type">
                            <div>Start Date</div>
                            <div>Completion Date</div>
                            <div>Higher Education Institution</div>
                        </div>
                        <div class="right-box-between-two-name" v-if="formData">
                            <div>{{ formData.StartDate }}</div>
                            <div>{{ formData.CompletionDate }}</div>
                            <div>{{ formData.HigherEducationInstitution }}</div>
                        </div>
                        <div class="right-box-between-two-type">
                            <div>Major</div>
                            <div>Length of Program</div>
                            <div>Education Level</div>
                        </div>
                        <div class="right-box-between-two-name" v-if="formData">
                            <div>{{ formData.Major }}</div>
                            <div>{{ formData.LengthOfProgram }}</div>
                            <div>{{ formData.EducationLevel }}</div>
                        </div>
                        <div class="right-box-between-two-type">
                            <div>Type of Education</div>
                            <div>Status</div>
                            <div>Certificate No. </div>
                        </div>
                        <div class="right-box-between-two-name" v-if="formData">
                            <div>{{ formData.TypeOfEducation }}</div>
                            <div>{{ formData.Status }}</div>
                            <div>{{ formData.CertificateNo }}</div>
                        </div>
                        <div class="right-box-between-two-type">
                            <div>President Name</div>
                        </div>
                        <div class="right-box-between-two-name" v-if="formData">
                            <div>{{ formData.PresidentName }}</div>
                        </div>
                    </div>

                    <!-- <div class="right-box-between-three">
                        <div class="right-box-between-three-title">
                            <b>Scanned copy of the original university certificate</b>
                        </div>
                        <div class="right-box-between-three-box">
                            <div class="right-box-between-three-box-top">
                                <div>Document Name</div>
                                <div>Upload Time</div>
                                <div>Size</div>
                                <div>Review</div>
                            </div>
                            <div class="right-box-between-three-box-botton">
                                <div>Zhangsan-University Certifi....jpg</div>
                                <div>2024-07-06 10:00:17</div>
                                <div>983kb</div>
                                <div>1</div>
                            </div>
                        </div>
                    </div>
                    <div class="right-box-between-three">
                        <div class="right-box-between-three-title">
                            <b>CHSI English Verification Report of University Certificate</b>
                        </div>
                        <div class="right-box-between-three-box">
                            <div class="right-box-between-three-box-top">
                                <div>Document Name</div>
                                <div>Upload Time</div>
                                <div>Size</div>
                                <div>Review</div>
                            </div>
                            <div class="right-box-between-three-box-botton">
                                <div>Zhangsan-University Certifi....jpg</div>
                                <div>2024-07-06 10:00:17</div>
                                <div>983kb</div>
                                <div>1</div>
                            </div>
                        </div>
                    </div>

                    <div class="right-box-between-f">
                        <div class="right-box-between-f-title">
                            <b>Order Information</b>
                        </div>
                        <div class="right-box-between-f-box">
                            <div class="right-box-between-f-box-top">
                                <div>Application ID</div>
                                <div>Order ID</div>
                                <div>Status</div>
                                <div>Amount</div>
                                <div>Submission Time</div>
                            </div>
                            <div class="right-box-between-f-box-botton">
                                <div>ZA9665589789</div>
                                <div>78021305567</div>
                                <div style="color: #F4B148;">pending</div>
                                <div>¥100.00</div>
                                <div>2024/7/9 09:51:01</div>
                            </div>
                        </div>
                    </div> -->

                    <button class="btn_red">
                        <RouterLink to="/Pay">Pay</RouterLink>
                    </button>

                </div>


                <div class="right-box-bottom">
                    <button class="btn_red_empty">
                        <RouterLink to="/UniversityCertificates">Edit</RouterLink>
                    </button>
                    <button class="btn_red_empty">
                        <RouterLink to="/MyCredentials">Back</RouterLink>
                    </button>
                </div>
            </div>
        </div>
    </div>
</template>
<style scoped>
.content {
    width: 1100px;
    height: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    margin-top: 100px;

    .title {
        display: flex;
        color: #1F2930;
        font-size: 20px;
        font-weight: 600;
        line-height: 30px;

        p {
            margin: 0 10px 20px 0;
        }

        .title-home {
            color: #0F094C;
        }
    }

    .box {
        display: flex;

        .left-box {
            display: flex;
            flex-direction: column;
            border: 1px solid #EFEFEF;
            width: 271px;
            margin: 0 20px 0 0;

            .left-box-active {
                p {
                    color: #EC535B;
                    font-weight: 700;
                    font-size: 18px;
                }

                background-color: #FFECEC;
            }

            p {
                margin: 20px 0 20px 10px;
                color: #1F2930;
                font-size: 18px;
                font-weight: 400;
            }
        }

        .right-box {
            border: 1px solid #EFEFEF;
            width: 900px;

            .right-box-title {
                margin: 20px;

            }

            .right-box-between {
                .right-box-between-one {
                    .right-box-between-one-box {
                        display: flex;

                        p {
                            margin: 20px;
                            font-size: 16px;
                        }

                        .button {
                            height: 28px;
                            margin: auto 0;
                            border-radius: 6px;
                            display: flex;
                            justify-content: center;
                            align-items: center;
                        }
                    }
                }

                .right-box-between-two {
                    margin: 20px;

                    .right-box-between-two-title {
                        font-size: 16px;
                        font-weight: 500;
                    }

                    .right-box-between-two-type {
                        display: flex;

                        div {
                            width: 219px;
                            height: 20px;
                            margin: 20px;
                            font-size: 16px;
                            color: #9A9A9A;
                        }
                    }

                    .right-box-between-two-name {
                        display: flex;

                        div {
                            width: 219px;
                            height: 20px;
                            margin: 20px;
                            font-size: 14px;
                        }
                    }
                }

                .right-box-between-three {
                    margin: 20px;

                    .right-box-between-three-title {
                        margin-bottom: 20px;
                    }

                    .right-box-between-three-box {
                        border: 1px solid #EFEFEF;
                        height: 116px;

                        .right-box-between-three-box-top {
                            display: flex;
                            background-color: #F6F6F6;
                            height: 56px;

                            div {
                                text-align: center;
                                width: 196px;
                                height: 20px;
                                margin: auto;
                                font-size: 16px;
                                color: #9A9A9A;

                            }
                        }

                        .right-box-between-three-box-botton {
                            display: flex;
                            height: 56px;

                            div {
                                text-align: center;
                                width: 196px;
                                height: 20px;
                                font-size: 14px;
                                margin: auto;

                            }
                        }
                    }
                }

                .right-box-between-f {
                    margin: 20px;

                    .right-box-between-f-title {
                        margin-bottom: 20px;
                    }

                    .right-box-between-f-box {
                        border: 1px solid #EFEFEF;
                        width: 698px;
                        height: 116px;

                        .right-box-between-f-box-top {
                            display: flex;
                            background-color: #F6F6F6;
                            height: 56px;

                            div {
                                text-align: center;
                                width: 196px;
                                height: 20px;
                                margin: auto;
                                font-size: 16px;
                                color: #9A9A9A;

                            }
                        }

                        .right-box-between-f-box-botton {
                            display: flex;
                            height: 56px;

                            div {
                                text-align: center;
                                width: 196px;
                                height: 20px;
                                font-size: 14px;
                                margin: auto;

                            }
                        }
                    }
                }

                button {
                    margin: 20px;
                    width: 126px;
                    height: 44px;
                    border-radius: 6px;
                    border: none;
                }

            }

            .right-box-bottom {
                display: flex;
                justify-content: end;

                button {
                    width: 149px;
                    height: 44px;
                    margin: 50px 50px 0 0;
                    border-radius: 6px;

                }
            }

        }


    }
}
</style>